<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--  引入核心皮肤-->
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <!--   引入核心js-->
    <script src="../../layui/layui.js"></script>
    <script>
        layui.use(['table', 'jquery'], function () {
            let $ = layui.jquery;//定义组件
            let table = layui.table;//定义表格组件
            table.render({
                elem: '#dg',
                url: '../../correct/autCor',
                //page: true,//开启分页
                parseData: function (res) {
                    console.log(res)
                    return {
                        "code": 0
                        , "msg": ""
                        , "count": 10
                        , "data": res
                    }
                },
                cols: [[ //表头
                    {type: 'checkbox'}
                    , {field: 'subid', title: '题目编号'}
                    , {field: 'subquestion', title: '题目内容'}
                    , {field: 'subanswer', title: '答案'}
                    , {field: 'check', title: '解析'}
                    , {field: 'subject', title: '科目'}
                    , {field: 'score', title: '得分', templet: "#dgScore"}
                ]]
            })
            $("#btn-dg").click(function () {
                alert("提交成功");
            })
        })

    </script>

    <script type="text/html" id="dgScore">
        <input type="text"></inpute>
    </script>
</head>
<body>
<div>
    主观题：
</div>
<table id="dg"></table>
<button id="btn-dg" type="button" class="layui-btn layui-btn-normal">提交</button>
</body>
</html>